package com.mew.chess.core.game.dyj.game.message;

import com.mew.chess.core.game.dyj.game.common.DyjConstantValue;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

import java.util.Collection;

/**
 * @author dylin
 * @create 2021/4/25
 */
@Data
@ToString
public class PushDealTimerMessage extends ZebraBaseMessage<PushDealTimerMessage> {
    private final int remainTime = DyjConstantValue.DEAL_TIMER_TIME;

    private long ino;//局号
    private HistoryMessage history;    //历史记录
    private Collection<UserMessage> bigRList;    //大玩家

    @Override
    public void write(ByteBuf b) {

        writeInt(b,remainTime);
        writeLong(b,ino);
        history.write(b);
        writeInt(b,bigRList.size());
        for (UserMessage userMessage : bigRList) {
            userMessage.write(b);
        }
    }

    @Override
    public PushDealTimerMessage read(ByteBuf byteBuf) {
        return null;
    }
}
